Function: fig2html

CALL:

html = fig2html(fig)

DESCRIPTION:

Convert figure to html which can be displayed in a webbrowser or in a jacontrol of type jeditorpane

INPUT:

fig figure
optional, handle of figure to convert, default value: gcf

OUTPUT:

html string
with html code: e.g.b
    <html><body><img
    src="data:image/png;base64,iVBORw0K...</img></body></html>

EXAMPLE:

  verified with:
  Matlab 2013a_64 (20170711)
  Matlab 2012a_32 (20170711)
  Matlab 2016b_32 (20170711)
  if nargin==0
       fig = figure;
       membrane;
       title('html with picture');
       html = fig2html(fig);
       ftemp=[tempname,'.html'];
       writestr(ftemp,html);
       web(ftemp);
       pause
       delete(ftemp)
       return
  end